package redisinit

import (
	"context"
	"fmt"
)

func StockGoodsSync(goodsId, goodsStock int64) {
	key := fmt.Sprintf("goods_stock:goods_id_%d", goodsId)
	for i := 0; i < int(goodsStock); i++ {
		RedisClient.RPush(context.Background(), key, goodsId)
	}
}
func DelGoodsSync(goodsId, goodsNum int64) {
	key := fmt.Sprintf("goods_num:goods_id_%d", goodsId)
	for i := 0; i < int(goodsNum); i++ {
		RedisClient.RPush(context.Background(), key)
	}
}
